

'''
    输入10次考试成绩！

'''

# for i in range(10):
#     score = input("请输入考试成绩：")
#
#     print(score)

'''
    打印从1~100之间的所有数字：
    开始：1
    结束：100
    自增：1
    任务：打印当前数字
'''
# a = 1
# while a <= 20:
#     print(a)
#     a = a + 1

# for i in range(1,21,1): # (开始，结束+1，自增数)
#     print(i)


# age = input("请输入您的年龄：") # "56"  -->  56
#
# age = int(age)#  "56"  -->  age = 56
#
# if age >= 18:
#     print("可以玩游戏！")
# else:
#     print("对不起，未成年！")


'''
    随机数模块：
        random模块：
        1. 导包
        
        2.调用randint(开始，结束) 就能得到随机数

'''
# import  random
#
# data = random.randint(0,500)
# print(data)


import random

#  让系统随机产生一个数字
data = random.randint(0,100)

money = 5000


count = 0
while money > 0:
    count = count + 1
    a = input("请输入您要猜的数字：")
    a = int(a)

    if a >  data:
        print("大了！")
        money = money - 500
    elif a < data:
        print("小了！")
        money = money - 500
    else:
        print("恭喜猜中了！本轮幸运数字：",data,"，您用了",count,"次机会！")
        money = money + 3000
        print("您要继续进行下一轮游戏吗？")
        result = input("yes/no:")
        if result == "yes":
            money = 5000
            count = 0
            data = random.randint(0, 100)
        else:
            break

















